package com.evil.enterprise.controller;

import com.evil.application.api.RemoteApplicationOrderLogService;
import com.evil.application.pojo.dto.order.log.OrderLogRespDTO;
import com.evil.common.core.entity.R;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 应用订单日志接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/application/order/log")
public class ApplicationOrderLogController {

    private final RemoteApplicationOrderLogService remoteApplicationOrderLogService;

    /**
     * 订单日志
     *
     * @param orderId orderId
     * @return R
     */
    @PostMapping("/list")
    public R<List<OrderLogRespDTO>> orderRecord(@RequestParam("orderId") Long orderId) {
        return R.success(remoteApplicationOrderLogService.orderLog(orderId));
    }

}
